home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / jmtl028c.zip / IGEN.H < prev    next >
C/C++ Source or Header  |  1993-04-03  |  6KB  |  144 lines

  1.  
  2. /* Variation on traplist.library.  New "official" nodelist.libray */
  3.  
  4. /* Based almost entirely on traplist.library, (C) 1990 Martin Laubach */
  5.  
  6. /* Inspired by structures written by Juergenn Hermann */
  7.  
  8. /* Slight adjustments made by Todd Kover 1:109/447 */
  9.  
  10.  
  11. #ifndef NL_NL_H
  12. #define NL_NL_H 1
  13.  
  14. #define NODELIST_NAME   "nodelist.library"
  15. #define NODELIST_VER    2L
  16.  
  17. /*-------------------------------------------------------------------------*/
  18. #define NL_USE_DOMAINS  0x00000001   /* Use domains in addr structure      */
  19.                                    /* Passed to NLOpen()                   */
  20.  
  21. /*-------------------------------------------------------------------------*/
  22. #define NL_VERBATIM 0x8000      /* Don't translate phone numbers in search */
  23.                /* A FindNL() with that flag will give you the phone number */
  24.                /* as it is listed in the nodelist                                                                       */
  25.  
  26. #define NL_PARSE_INVALID_CHAR   -1              /* Returned by NLParseAddr */
  27. #define NL_PARSE_INVALID_NUMBER -2
  28.  
  29. /*-------------------------------------------------------------------------*/
  30. /* defined/reserved Tag IDs */
  31.  
  32. #define ID_PASS 0x50415353              /* password entry   */
  33. #define ID_TCNF 0x55434E46              /* TD config entry  */
  34. #define ID_ACCT 0x41434354              /* accounting entry */
  35.  
  36. /*-------------------------------------------------------------------------*/
  37. /* Use these macros in NLEnumNode() */
  38.  
  39. #define IS_ZONE(ad,re)   (ad->Zone == ad->Net && ad->Net == re && !ad->Node && !ad->Point)
  40. #define IS_NET(ad,re)    (!ad->Node && !ad->Point)
  41. #define IS_NODE(ad,re)   (ad->Node && !ad->Point)
  42. #define IS_POINT(ad,re)  (ad->Point)
  43. #define IS_REGION(ad,re) (!ad->Node && !ad->Point && re == ad->Net)
  44.  
  45. /*-------------------------------------------------------------------------*/
  46. typedef struct
  47.         {
  48.         WORD Zone;
  49.         WORD Net;
  50.         WORD Node;
  51.         WORD Point;
  52.         char *Domain;
  53.         } Addr;
  54.  
  55. /* This structure is returned by NLFind() and NLIndexFind() */
  56.  
  57. typedef struct
  58.         {
  59.         Addr Node;                                         /* node address */
  60.         WORD Region;                                 /* region (0 if none) */
  61.         WORD Hub;                 /* node # of this node's HUB (0 if none) */
  62.         char *System;                                         /* node name */
  63.         char *Sysop;                                         /* sysop name */
  64.         char *Phone;                                       /* phone number */
  65.         char *City;                                      /* city and state */
  66.         char *Passwd;                                          /* password */
  67.         char *Flags;                                     /* nodelist flags */
  68.         LONG Cost;                                                 /* cost */
  69.         UWORD BaudRate;                                       /* baud rate */
  70.         LONG ID;                      /* unique ID (offset into nodeindex) */
  71.         char *Line;                  /* Line as it appears in the NODELIST */
  72.         } NodeDesc;
  73.  
  74. /*-------------------------------------------------------------------------*/
  75. #ifndef NL_PRIVATE
  76.  
  77. typedef void *Extra;
  78. typedef void *NodeList;
  79.  
  80. void LibArexx(void);
  81.  
  82. NodeList NLOpen(char *, ULONG);
  83. void NLClose(NodeList);
  84. NodeDesc *NLFind(NodeList, Addr *, ULONG);
  85. int NLAddrComp(Addr *, Addr *);
  86. void NLFreeNode(NodeDesc *);
  87. NodeDesc *NLIndexFind(NodeList, Addr *, ULONG);
  88.  
  89. Extra ExtraOpen(char *);
  90. void *ExtraFromNL(NodeList);
  91. void ExtraClose(Extra);
  92. void *ExtraFind(Extra, Addr *addr, ULONG, ULONG *);
  93. void *ExtraFindLock(Extra, Addr *addr, ULONG, ULONG *);
  94. BOOL ExtraPut(Extra, Addr *, ULONG, int, void *);
  95. BOOL ExtraChange(Extra, Addr *, ULONG, int, void *);
  96. BOOL ExtraDel(Extra, void *);
  97. BOOL ExtraFlush(Extra);
  98. void ExtraLock(Extra);
  99. void ExtraUnlock(Extra);
  100. LONG ExtraEnumNode(Extra, BOOL (*)(Addr *, void *), void *);
  101. void ExtraChanged(Extra);
  102. LONG ExtraEnumTag(Extra, Addr *, BOOL (*)(void *, ULONG, ULONG, void *), void *);
  103.  
  104. LONG NLEnumNode(NodeList, LONG, Addr *, BOOL (*)(Addr *, ULONG, void *), void *);
  105.  
  106. LONG NLParseAddr(Addr *, char *, Addr *);
  107.  
  108. BOOL NLSubmitNewIndex(NodeList, char *, char *);
  109.  
  110. void ExtraLockTag(Extra, void *);
  111. void ExtraUnlockTag(Extra, void *);
  112. /* #pragma libcall NodelistBase LibArexx 1E 9802 */
  113. #pragma libcall NodelistBase NLOpen 24 0802
  114. #pragma libcall NodelistBase NLClose 2A 801
  115. #pragma libcall NodelistBase NLFind 30 09803
  116. #pragma libcall NodelistBase NLFreeNode 36 801
  117. #pragma libcall NodelistBase NLAddrComp 3C 9802
  118. #pragma libcall NodelistBase NLIndexFind 42 09803
  119. #pragma libcall NodelistBase ExtraFromNL 48 801
  120. #pragma libcall NodelistBase ExtraOpen 4E 801
  121. #pragma libcall NodelistBase ExtraClose 54 801
  122. #pragma libcall NodelistBase ExtraFind 5A A09804
  123. #pragma libcall NodelistBase ExtraPut 60 A109805
  124. #pragma libcall NodelistBase ExtraDel 66 9802
  125. /*#pragma libcall NodelistBase ObsoleteOldIndexFind 6C 09803 */
  126. #pragma libcall NodelistBase ExtraFlush 72 801
  127. #pragma libcall NodelistBase ExtraLock 78 801
  128. #pragma libcall NodelistBase ExtraUnlock 7E 801
  129. #pragma libcall NodelistBase ExtraEnumNode 84 A9803
  130. #pragma libcall NodelistBase ExtraChanged 8A 801
  131. #pragma libcall NodelistBase ExtraEnumTag 90 BA9804
  132. #pragma libcall NodelistBase NLEnumNode 96 BA90805
  133. #pragma libcall NodelistBase NLParseAddr 9C A9803
  134. #pragma libcall NodelistBase NLSubmitNewIndex A2 9802
  135. /* ExtraLockTag(xtra, address)(A0,A1)*/
  136. /* ExtraUnlockTag(xtra, address)(A0,A1)*/
  137. /* ExtraChange(xtra, addr, tag, size, data)(A0,A1,D0,D1,A2)*/
  138. /* ExtraFindLock(xtra, addr, tag, size)(A0,A1,D0,A2)*/
  139. #endif
  140.  
  141. #endif
  142. /*-------------------------------------------------------------------------*/
  143. /* ID: 134.55@5229  Last Changed: 30 Apr 1991 02:48:00 by mjl */
  144.